"""
Channels inherit from the expectable class, which adds expect functionality to
anything implementing the channel interface.

Copyright (c) 2009 Christopher Hesse
http://code.google.com/p/python-expect/
"""


class PexpectWrapper(object):
    """
    Pexpect compatibility wrapper.  Create this with a channel and it will
    emulate a Pexpect object.
    
    Example:
        
        p = PexpectWrapper(EchoChannel())
        p.expect([])
        
    """
    
    def __init__(self, channel):
        self.channel = channel
        
    def expect(self, patterns):
        pass
        
    def fileno(self):
        return self.channel.fileno()
        
    def close(self):
        return self.channel.close()
        
    def flush(self):
        return self.channel.flush()